<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ page import="org.springframework.security.core.Authentication"%>
<%@ page
	import="org.springframework.security.core.context.SecurityContextImpl"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="/common/meta.jsp"></jsp:include>
<jsp:include page="/common/css_js.jsp"></jsp:include>

</head>

<%
Object securityContent = session.getAttribute("SPRING_SECURITY_CONTEXT");
if (securityContent == null) {
	response.sendRedirect(request.getContextPath() + "/login.jsp");
	return;
}
SecurityContextImpl security = (SecurityContextImpl) securityContent;
Authentication auth = security.getAuthentication();
if (auth == null) {
	response.sendRedirect(request.getContextPath() + "/login.jsp");
	return;
}
String userName = auth.getName();
if (userName == null) {
	response.sendRedirect(request.getContextPath() + "/login.jsp");
	return;
}
%>
<script type="text/javascript">
function logout(){
	if (confirm("您确定要退出控制面板吗？")){
		top.location="${ctx}/j_spring_security_logout";
	}
	return false;
}
function showsubmenu(sid) {
	var whichEl = eval("submenu" + sid);
	var menuTitle = eval("menuTitle" + sid);
	if (whichEl.style.display == "none"){
		eval("submenu" + sid + ".style.display=\"\";");
	}else{
		eval("submenu" + sid + ".style.display=\"none\";");
	}
}

</script>
<body>
<table width="100%" height="64" border="0" cellpadding="0" cellspacing="0" class="admin_topbg">
  <tr>
    <td width="61%" height="64"><img src="${ctx}/images/logo.gif" width="262" height="64"></td>
    <td width="39%" valign="top">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="74%" height="38" class="admin_txt">管理员：<b><%=userName%></b> 您好,感谢登陆使用！</td>
        <td width="22%" align="right"><a href="${ctx}/j_spring_security_logout" target="_self" onClick="return logout();"><img src="${ctx}/images/out.gif" alt="安全退出" width="46" height="20" border="0"></a></td>
        <td width="4%">&nbsp;</td>
      </tr>
      <tr>
        <td height="19" colspan="3">&nbsp;</td>
        </tr>
    </table>
    </td>
  </tr>
</table>
</body>
</html>
